<template>
	<el-drawer title="行程详情" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form>
					<el-form-item label="领导姓名">
						<div style="width: 100%;">
							<el-avatar :src="form.avatar" size="small" style="margin-top: 5px;"></el-avatar>
							<span style="position: absolute;margin-left: 15px">{{form.leaderUserName}}</span>
							<span style="float: right">
								<div>
									<el-icon style="margin-right: 10px;"><el-icon-clock/></el-icon>{{form.createTime}}
								</div>
							</span>
						</div>
					</el-form-item>
					<el-form-item label="行程标题">
						<span style="font-weight: 600;font-size: 16px">{{form.title}}</span>
					</el-form-item>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="行程类型">
								{{form.ledActTypeName}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="状态">
								<el-tag type="success" v-if="form.status=='1'">生效中</el-tag>
								<el-tag type="warning" v-else>未生效</el-tag>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="开始时间">
								{{form.beginTime}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="结束时间">
								{{form.endTime}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-form-item label="行程内容">
						<div v-html="form.remark"></div>
					</el-form-item>
				</el-form>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
export default {
	emits: ['success', 'closed'],
	components: {
	},
	data() {
		return {
			loading: false,
			form: {
				recordId:'',
				avatar:'',
				title: '',
				leaderUserName:'',
				createTime:"",
				ledActType: '',
				ledActTypeName:"",
				leader: '',
				beginTime:'',
				endTime:'',
				remark:'',
				msgType:''
			},
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {

	},
	methods: {
		//显示
		open(){
			this.visible = true;
			return this;
		},
		//表单注入数据
		setData(data){
			this.form.recordId = data.recordId
			this.form.avatar = data.avatar
			this.form.title = data.title
			this.form.leaderUserName = data.leaderUserName
			this.form.ledActTypeName = data.ledActTypeName
			this.form.status = data.status
			this.form.createTime = data.createTime
			this.form.ledActType = data.ledActType
			this.form.leader = data.leader
			this.form.beginTime = data.beginTime
			this.form.endTime = data.endTime
			this.form.remark = data.remark
			this.form.msgType = data.msgType
		},
		async getLeadActivityById(data)
		{
			let res = await this.$API.info.leadActivity.getLeadActivityById.get({recordId:data});
			{
				if(res.code==200)
				{
					this.form.recordId = res.data.recordId
					this.form.avatar = res.data.avatar
					this.form.title = res.data.title
					this.form.leaderUserName = res.data.leaderUserName
					this.form.ledActTypeName = res.data.ledActTypeName
					this.form.status = res.data.status
					this.form.createTime = res.data.createTime
					this.form.ledActType = res.data.ledActType
					this.form.leader = res.data.leader
					this.form.beginTime = res.data.beginTime
					this.form.endTime = res.data.endTime
					this.form.remark = res.data.remark
					this.form.msgType = res.data.msgType
				}else
				{
					this.$alert(res.message, "提示", {type: 'error'})
				}
			}
		}
	}
}
</script>

<style>
</style>
